from threading import Thread
from __builtin__ import setattr

class B():
    pass

class A(Thread):
    def __init__(self):
        Thread.__init__(self)
        
    def custom_method(self):
        return "this is custom method"
    

class XDictProxy(dict):

    def __init__(self, original):
        self.__original = original
        self.__custom = {}

    def __getitem__(self, key):
        if key in self.__custom:
            return self.__custom[key]
        else:
            return self.__original[key]
        
    def __setitem__(self, key, value):
        self.__custom[key] = value
        
    def keys(self):
        return self.__original.keys()
    
    def __str__(self):
        #return self.__original.__str__()
        items = self.__original.items()
        items.extend(self.__custom.items())
        items_as_string = map(str, items)
        joined_items = ','.join(items_as_string)
        
        return '{' + joined_items + '}'

setattr(A, '__init__', 'nada')
print A.__init__

A()
